package com.shenyi.shop.service;

import com.shenyi.shop.api.IUserService;
import com.shenyi.shop.dao.UserMapper;
import com.shenyi.shop.entity.UserDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author richard.fan
 * @version 1.0
 * @date 2018/11/05
 * @desc 会员
 * @see
 * @since 1.0
 */
@Service
public class UserServiceImpl implements IUserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public UserDO queryObject(Integer id) {
        return userMapper.queryObject(id);
    }

    @Override
    public List<UserDO> queryList(Map<String, Object> map) {
        return userMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return userMapper.queryTotal(map);
    }

    @Override
    public int save(UserDO user) {
        user.setRegisterTime(new Date());
        return userMapper.save(user);
    }

    @Override
    public int update(UserDO user) {
        return userMapper.update(user);
    }

    @Override
    public int delete(Integer id) {
        return userMapper.delete(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return userMapper.deleteBatch(ids);
    }
}
